From 0a4510a27da9f7748ad5a31b41d6544173f47f10 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 18 Dec 2013 13:10:58 +0800 Subject: [PATCH] * replace.el (occur-engine): Avoid infloop. --- lisp/ChangeLog | 4 ++++ lisp/replace.el | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 00b0115a6f6..776f9b0e764 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2013-12-18 Chong Yidong + + * replace.el (occur-engine): Avoid infloop (Bug#7593). + 2013-12-18 Kazuhiro Ito (tiny change) * progmodes/make-mode.el (makefile-fill-paragraph): Fix infloop diff --git a/lisp/replace.el b/lisp/replace.el index 061300c7829..2c6b02364b2 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1457,7 +1457,9 @@ See also `multi-occur'." ;; so as to override faces copied from the buffer. `(face ,match-face))) curstring) - (setq start (match-end 0)))) + ;; Avoid infloop (Bug#7593). + (let ((end (match-end 0))) + (setq start (if (= start end) (1+ start) end))))) ;; Generate the string to insert for this match (let* ((match-prefix ;; Using 7 digits aligns tabs properly. -- 2.30.2